<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMallProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mall_products', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('名称');
            $table->string('images')->comment('图片');
            $table->string('thumbnail')->comment('商品缩略图');
            $table->integer('type')->unsigned()->comment('产品分类');
            $table->integer('tag')->unsigned()->unsigned()->comment('产品标签');
            $table->decimal('price', 8, 2)->unsigned()->comment('价格');
            $table->decimal('original_price', 8, 2)->unsigned()->comment('原价');
            $table->integer('need_jb')->unsigned()->comment('需要多少金币兑换');
            $table->string('taobao_url')->nullable()->comment('淘宝链接');
            $table->text('description')->comment('产品描述');
            $table->tinyInteger('sort')->comment('排序');
            $table->tinyInteger('on_sale')->default(1)->commnet('是否上架 1:上架 0:未上架');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
